package com.fly;

import java.util.stream.Stream;

import org.apache.commons.lang3.RandomUtils;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableScheduling;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@EnableCaching
@EnableScheduling
@SpringBootApplication
public class DockerApplication
{
    public static void main(String[] args)
    {
        Stream.of(args).forEach(log::info);
        if (RandomUtils.nextBoolean())
        {
            SpringApplication.run(DockerApplication.class, args);
            return;
        }
        log.info("### Banner.Mode.OFF");
        SpringApplication application = new SpringApplication(DockerApplication.class);
        application.setBannerMode(Banner.Mode.OFF);
        application.setLogStartupInfo(false);
        application.run(args);
    }
}
